package com.aps.common.model;

import com.aps.common.model.standardAps.StandardApsEquipment;
import com.aps.common.model.standardAps.StandardApsOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author jsy
 * @description:APS算法标准参数模型及构造参数模型
 * @date 2025/9/18 15:59
 */
@Schema(description = "标准APS参数模型")
@Data
public class ApsParameterModel {
    @Schema(description = "租户ID")
    private final String tenantId;

    @Schema(description = "设备信息")
    private List<StandardApsEquipment> apsEquipments;

    @Schema(description = "订单信息")
    private List<StandardApsOrder> apsOrders;

    /**
     * @description:私有构造方法，只能通过Builder创建实例
     * @author: jsy
     * @time: 2025/9/18 17:51
     */
    private ApsParameterModel(Builder builder) {
        this.tenantId = builder.tenantId;
        this.apsEquipments = builder.apsEquipments;
        this.apsOrders = builder.apsOrders;
    }

    public static class Builder {
        @Schema(description = "租户ID")
        private final String tenantId;

        @Schema(description = "设备信息")
        private List<StandardApsEquipment> apsEquipments;

        @Schema(description = "订单信息")
        private List<StandardApsOrder> apsOrders;

        public Builder(String tenantId) {
            this.tenantId = tenantId;
        }

        public Builder addApsEquipments(List<StandardApsEquipment> apsEquipments) {
            this.apsEquipments = apsEquipments;
            return this;
        }

        public Builder addApsOrders(List<StandardApsOrder> apsOrders) {
            this.apsOrders = apsOrders;
            return this;
        }

        /**
         * @description: 构造参数模型
         * @author: jsy
         * @time: 2025/9/18 17:47
         */
        public ApsParameterModel build() {
            return new ApsParameterModel(this);
        }
    }
}
